class Dog:
    # 类属性
    species = "Canis familiaris"

    # 初始化方法（构造函数）
    def __init__(self, name, age):
        self.name = name
        self.age = age

    # 方法
    def description(self):
        return f"{self.name} is {self.age} years old"

    def speak(self, sound):
        return f"{self.name} says {sound}"


buddy = Dog("Buddy", 3)
print(buddy) # <__main__.Dog object at 0x00000191210C8EC0>
print(buddy.description())  # 输出: Buddy is 3 years old
print(buddy.speak("Woof Woof"))  # 输出: Buddy says Woof Woof
print(buddy.species)  # 输出: Canis familiaris
